<?php
namespace common\models\shop;

use common\models\Common;
use yii\db\ActiveRecord;

class GoodsDetail extends Common
{
    public static function tableName()
    {
        return '{{%goods_detail}}';
    }

    //获取detail 对应的  banner
    public function getBanner() {
        return $this->hasMany(GoodsDetailBanner::className(), ['goods_detail_id' => 'id']);
    }

    //获取detail 对应的  banner
    public function getGoods() {
        return $this->hasOne(Goods::className(), ['id' => 'goods_id']);
    }
}